unit uDM;

interface

uses
  SysUtils, Classes, DBXFirebird, DB, SqlExpr, UniProvider,
  InterBaseUniProvider, DBAccess, Uni;

type
  TDM = class(TDataModule)
    SQLConnection1: TSQLConnection;
    UniConnection1: TUniConnection;
    UniSQL1: TUniSQL;
    InterBaseUniProvider1: TInterBaseUniProvider;
    SQLConnection2: TSQLConnection;
    UCConfigs: TUniConnection;
    procedure UniConnection1AfterConnect(Sender: TObject);
    procedure UniConnection1AfterDisconnect(Sender: TObject);
    procedure UCConfigsBeforeConnect(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DM: TDM;

implementation

uses uPrincipal;

{$R *.dfm}

procedure TDM.UCConfigsBeforeConnect(Sender: TObject);
var vPath : string;
begin
  vPath := ExtractFilePath(ParamStr(0));
  UCConfigs.Database := vPath + 'Config.fdb';
end;

procedure TDM.UniConnection1AfterConnect(Sender: TObject);
begin
  FrmPrincipal.PanelBtns.Visible := True;
end;

procedure TDM.UniConnection1AfterDisconnect(Sender: TObject);
begin
    if FrmPrincipal.Visible = True then FrmPrincipal.PanelBtns.Visible := False;
end;



end.
